import http from './http'
// 轮播图接口
function getBanner (){ 
  return http({
    url:"home/swiperdata",
  })

}
// 导航接口
function getNavlist() {
  return http({
    url:"home/catitems"
  })
}

// 楼层接口
function getFlows() {
   return http({
     url:"home/floordata"
   })
}

// 商品分类接口
function getClassify() {
  return http({
    url:"categories"
  })
}
// 商品列表或者搜索
function getgoodList(params) {
    return http({
        url:"goods/search",
        data:params
    })
}
// 商品详情接口
function getgoodDetail(id) {
    return http({
        url:`goods/detail?goods_id=${id}`,
       
    })
    
}
// 登录接口
function getlogin(params) {
   return http({
     url:"users/wxlogin",
     method:"post",
     data:params
   })
}
// 订单接口
function getdingdan(params) {
     return http({
       url:"my/orders/create",
       method:"post",
       header: {
        'Authorization':wx.getStorageSync("token"),
        },
        data:params
     })
    
}


// 历史订单
function orderAll(params) {
 return   http({
   url:"my/orders/all",
   data:params

 })
}

export {
  getBanner,
  getNavlist,
  getFlows,
  getClassify,
  getgoodList,
  getgoodDetail,
  getlogin,
  getdingdan,
  orderAll
}